/// Creator:      gaoruishan
/// CreatDate:    2025-08-12
/// Description:  初始化数据
Class Nur.MNISV3.Init Extends %RegisteredObject
{

/// 开发调试
/// d ##class(Nur.MNISV3.Init).debug()
ClassMethod debug()
{
    d ..clear()
    d ..blood()
    d ..tour()
    d ..pho()
    d ..workType()
}

/// 清空配置信息
/// d ##class(Nur.MNISV3.Init).clear()
ClassMethod clear()
{
   // 输血节点 CF.NUR.MNISV3.BloodNode
   k ^CF.NUR.MNISV3.BloodNodeD  ;先清空
   k ^CF.NUR.MNISV3.BloodNodeI  ;先清空
   
   // 模板组件 CF.NUR.MNISV3.ModelForm  父表
   k ^CF.NUR.MNISV3.ModelFormD
   k ^CF.NUR.MNISV3.ModelFormI
   
   // 模板字段配置 CF.NUR.MNISV3.ModelItem  子表
   k ^CF.NUR.MNISV3.ModelItemD
   k ^CF.NUR.MNISV3.ModelItemI
   
   // 工作统计类型表 CF.NUR.MNISV3.IPIFWorkType
   k ^CF.NUR.MNISV3.IPIFWorkTypeD ;先清空
   k ^CF.NUR.MNISV3.IPIFWorkTypeI ;先清空
   
   // 患者交接 CF.NUR.MNISV3.PHOType  父表
   k ^CF.NUR.MNISV3.PHOTypeD
   k ^CF.NUR.MNISV3.PHOTypeI
   
   // 患者交接 CF.NUR.MNISV3.PHONode 子表
   k ^CF.NUR.MNISV3.PHONodeD
   k ^CF.NUR.MNISV3.PHONodeI
}

/// 第一步: 初始化 输血配置信息  *******必须按步骤来,因为有些id是写死的 *******
/// d ##class(Nur.MNISV3.Init).blood()
ClassMethod blood()
{
   //1，节点 CF.NUR.MNISV3.BloodNode
   //1-ID  2-NodeName 3-NodeCode 4-NodeType  5-NodeSort 6-HospId 7-ValidFlag是否有效 8-RequiredFlag必要条件 
   //9-【必填】NodeSub可操作节点 10-ShowFlag 11-【必填】ModelCode关联模板 12-ShowModelCode显示模板Code 13-PatFlag是否校验患者 14-SignFlag签名标记(double 双签  single/空 单签)
   //s ^CF.NUR.MNISV3.BloodNodeD(2)=$lb("","取血","G","BLOOD","1","2","Y","R","R","","PATINFO!BLOODINFO","","","","")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|默认^NodeCode|D^NodeType|BLOOD^NodeSort|0^HospId|2^ValidFlag|Y^RequiredFlag|^NodeSub|G")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|取血^NodeCode|G^NodeType|BLOOD^NodeSort|1^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|R^ModelCode|PATINFO!BLOODINFO!GETENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|接收^NodeCode|R^NodeType|BLOOD^NodeSort|2^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|BT^ModelCode|PATINFO!BLOODINFO!GETENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|输血前巡视^NodeCode|BT^NodeType|BLOOD^NodeSort|3^HospId|2^ValidFlag|Y^RequiredFlag|F^NodeSub|S^ModelCode|PATINFO!BLOODINFO!TOURENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|开始^NodeCode|S^NodeType|BLOOD^NodeSort|4^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|T!SU^ModelCode|PATINFO!BLOODINFO!STARTENTER^PatFlag|Y^SignFlag|D")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|巡视^NodeCode|T^NodeType|BLOOD^NodeSort|5^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|SU!C!E^ModelCode|PATINFO!BLOODINFO!TOURENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|暂停^NodeCode|SU^NodeType|BLOOD^NodeSort|6^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|C!E^ModelCode|PATINFO!BLOODINFO!TOURENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|继续^NodeCode|C^NodeType|BLOOD^NodeSort|7^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|SU!E^ModelCode|PATINFO!BLOODINFO!TOURENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|结束^NodeCode|E^NodeType|BLOOD^NodeSort|8^HospId|2^ValidFlag|Y^RequiredFlag|R^NodeSub|AT^ModelCode|PATINFO!BLOODINFO!ENDENTER^PatFlag|Y")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|输血后巡视^NodeCode|AT^NodeType|BLOOD^NodeSort|9^HospId|2^ValidFlag|Y^RequiredFlag|L^NodeSub|RE^ModelCode|PATINFO!BLOODINFO!TOURENTER")
   w ##class(CF.NUR.MNISV3.BloodNode).Save("","NodeName|回收^NodeCode|RE^NodeType|BLOOD^NodeSort|10^HospId|2^ValidFlag|Y^RequiredFlag|R^ModelCode|PATINFO!BLOODINFO!RETRIEVEENTER")

   
   //2，模板组件 CF.NUR.MNISV3.ModelForm  父表
   //子表 Relationship ChildRec As CF.NUR.MNISV3.ModelItem
   //1-ID 2-FormCode模板代码(索引-新建或更新) 3-FormName模板名称  4-FormSort顺序  5-LabelFlag标签显示 6-SimpleFlag精简标记 7-HospId
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|PATINFO^FormName|患者信息^FormSort|1^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|BLOODINFO^FormName|血袋信息^FormSort|2^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|GETENTER^FormName|取血输入信息^FormSort|3^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|STARTENTER^FormName|开始输入信息^FormSort|4^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|TOURENTER^FormName|巡视输入信息^FormSort|5^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|ENDENTER^FormName|结束输入信息^FormSort|6^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|RETRIEVEENTER^FormName|回收输入信息^FormSort|7^FormType|BLOOD^LabelFlag|^SimpleFlag|^HospId|2")

   //3，模板字段配置 CF.NUR.MNISV3.ModelItem  子表
   //ModeFormId 对应父表的ID, ModelCode 模板代码 + ItemCode 字段代码 --->索引(新建或更新)
   // 键盘类型 1,体征键盘 "TEMP" 2,对于Android类型: 文本TYPE_CLASS_TEXT=1; 数字TYPE_CLASS_NUMBER=2; TYPE_NUMBER_FLAG_DECIMAL=2000
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|1^ModelCode|DHCNurBloodTransPda^ItemName|姓名^ItemCode|PatName^ItemType|T^Position|1,1^LinkCode|^DataSource|name")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|1^ModelCode|DHCNurBloodTransPda^ItemName|床号^ItemCode|BedCode^ItemType|T^Position|2,1^LinkCode|^DataSource|bedCode")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|1^ModelCode|DHCNurBloodTransPda^ItemName|科室^ItemCode|PatLoc^ItemType|T^Position|3,1^LinkCode|^DataSource|wardDesc")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|1^ModelCode|DHCNurBloodTransPda^ItemName|性别^ItemCode|PatSex^ItemType|T^Position|4,1^LinkCode|^DataSource|sex")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|1^ModelCode|DHCNurBloodTransPda^ItemName|登记号^ItemCode|PatRegNo^ItemType|T^Position|5,1^LinkCode|^DataSource|regNo")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|患者信息^ItemCode|BloodPatName^ItemType|T^Position|1,1^LinkCode|^DataSource|patName^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|床号^ItemCode|BloodBedCode^ItemType|T^Position|1,2^LinkCode|^DataSource|bedCode^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|登记号^ItemCode|BloodPatRegNo^ItemType|T^Position|1,3^LinkCode|^DataSource|patRegNo^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|输血种类^ItemCode|ProductDesc^ItemType|T^Position|2,1^LinkCode|^DataSource|productDesc^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|血量^ItemCode|Volume^ItemType|T^Position|3,1^LinkCode|^DataSource|volume^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|血型^ItemCode|BloodGroup^ItemType|T^Position|4,1^LinkCode|^DataSource|bloodGroup^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|交叉配血结果^ItemCode|xmResult^ItemType|T^Position|5,1^LinkCode|^DataSource|xmResult^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|失效时间^ItemCode|ExpireDateTime^ItemType|T^Position|6,1^LinkCode|^DataSource|expireDateTime^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|献血码^ItemCode|BloodbagId^ItemType|T^Position|7,1^LinkCode|^DataSource|bloodbagId^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|2^ModelCode|DHCNurBloodTransPda^ItemName|产品码^ItemCode|BloodProductId^ItemType|T^Position|8,1^LinkCode|^DataSource|bloodProductId^LabelFlag|Y")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|3^ModelCode|DHCNurBloodTransPda^ItemName|输血外观无异常^ItemCode|Item1^ItemType|M^Position|1,1^LinkCode|Item1^ItemOption|是!否")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|3^ModelCode|DHCNurBloodTransPda^ItemName|输血装置完好^ItemCode|Item2^ItemType|M^Position|2,1^LinkCode|Item2^ItemOption|是!否")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|体温^ItemCode|Temperature^ItemType|E^Position|1,1^LinkCode|Item1^SignCode|Item1^KeyboardType|TEMP")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|脉搏^ItemCode|Pulse^ItemType|E^Position|1,2^LinkCode|Item2^SignCode|pulse^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|心率^ItemCode|Heartbeat^ItemType|E^Position|1,3^LinkCode|Item3^SignCode|heartbeat^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|呼吸^ItemCode|Breath^ItemType|E^Position|2,1^LinkCode|Item4^SignCode|breath^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|收缩压^ItemCode|SysPressure^ItemType|E^Position|2,2^LinkCode|Item5^SignCode|sysPressure^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|舒张压^ItemCode|DiaPressure^ItemType|E^Position|2,3^LinkCode|Item6^SignCode|diaPressure^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|滴速^ItemCode|BloodSpeed^ItemType|E^Position|3,1^LinkCode|Item7^SignCode|^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|抗过敏药物^ItemCode|IfOrd^ItemType|M^Position|4,1^LinkCode|Item8^SignCode|^KeyboardType|^ItemOption|有!无")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|4^ModelCode|DHCNurBloodTransPda^ItemName|药物名称^ItemCode|OrdName^ItemType|E^Position|5,1^LinkCode|Item9^SignCode|^KeyboardType|^ItemOption|")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|体温^ItemCode|Temperature^ItemType|E^Position|1,1^LinkCode|Item1^SignCode|Item1^KeyboardType|TEMP")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|脉搏^ItemCode|Pulse^ItemType|E^Position|1,2^LinkCode|Item2^SignCode|pulse^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|心率^ItemCode|Heartbeat^ItemType|E^Position|1,3^LinkCode|Item3^SignCode|heartbeat^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|呼吸^ItemCode|Breath^ItemType|E^Position|2,1^LinkCode|Item4^SignCode|breath^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|收缩压^ItemCode|SysPressure^ItemType|E^Position|2,2^LinkCode|Item5^SignCode|sysPressure^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|舒张压^ItemCode|DiaPressure^ItemType|E^Position|2,3^LinkCode|Item6^SignCode|diaPressure^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|滴速^ItemCode|BloodSpeed^ItemType|E^Position|3,1^LinkCode|Item7^SignCode|^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|不良反应^ItemCode|ADRS^ItemType|R^Position|4,1^LinkCode|Item8^SignCode|^KeyboardType|^ItemOption|有!无")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|症状^ItemCode|Symptom^ItemType|M^Position|5,1^LinkCode|Item9^SignCode|^KeyboardType|^ItemOption|皮疹!寒战!发热!腰痛!血尿!胸闷!心悸!四肢抽搐!其他")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|症状其他^ItemCode|SymptomElse^ItemType|E^Position|6,1^LinkCode|Item10^SignCode|^KeyboardType|^ItemOption|")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|5^ModelCode|DHCNurBloodTransPda^ItemName|处理措施^ItemCode|Measure^ItemType|E^Position|7,1^LinkCode|Item11^SignCode|^KeyboardType|^ItemOption|")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|6^ModelCode|DHCNurBloodTransPda^ItemName|不良反应^ItemCode|ADRS^ItemType|R^Position|1,1^LinkCode|Item1^SignCode|^KeyboardType|^ItemOption|有!无")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|6^ModelCode|DHCNurBloodTransPda^ItemName|症状^ItemCode|Symptom^ItemType|M^Position|2,1^LinkCode|Item2^SignCode|^KeyboardType|^ItemOption|皮疹!寒战!发热!腰痛!血尿!胸闷!心悸!四肢抽搐!其他")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|6^ModelCode|DHCNurBloodTransPda^ItemName|症状其他^ItemCode|SymptomElse^ItemType|E^Position|3,1^LinkCode|Item3^SignCode|^KeyboardType|^ItemOption|")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|6^ModelCode|DHCNurBloodTransPda^ItemName|处理措施^ItemCode|Measure^ItemType|E^Position|4,1^LinkCode|Item4^SignCode|^KeyboardType|^ItemOption|")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|6^ModelCode|DHCNurBloodTransPda^ItemName|余量^ItemCode|LeftVolume^ItemType|E^Position|5,1^LinkCode|Item5^SignCode|^KeyboardType|^ItemOption|^ItemDefault|0")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|6^ModelCode|DHCNurBloodTransPda^ItemName|结束类型^ItemCode|EndType^ItemType|M^Position|6,1^LinkCode|Item6^SignCode|^KeyboardType|^ItemOption|结束!终止^ItemDefault|结束")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|7^ModelCode|DHCNurBloodTransPda^ItemName|去向^ItemCode|Where^ItemType|M^Position|1,1^LinkCode|Item1^SignCode|^KeyboardType|^ItemOption|血库!检验科!废弃^ItemDefault|废弃")
}

/// 第二步: 初始化 巡视配置信息 *******必须按步骤来,因为有些id是写死的 *******
/// d ##class(Nur.MNISV3.Init).tour()
ClassMethod tour() As %Status
{
    //2，模板组件 CF.NUR.MNISV3.ModelForm  父表
   //子表 Relationship ChildRec As CF.NUR.MNISV3.ModelItem
   //1-ID 2-FormCode模板代码(索引-新建或更新) 3-FormName模板名称  4-FormSort顺序  5-LabelFlag标签显示 6-SimpleFlag精简标记 7-HospId
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|DHCNurGradeTourPda^FormName|分级巡视^FormSort|1^FormType|TOUR^LabelFlag|^SimpleFlag|^HospId|2^FormSub|全部!特级护理!一级护理!二级护理!三级护理")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|DHCNurInfusionTourPda^FormName|输液巡视^FormSort|2^FormType|TOUR^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|DHCNurSpotTourPda^FormName|地点巡视^FormSort|3^FormType|TOUR^LabelFlag|^SimpleFlag|^HospId|2^FormSub|全部!开水房!走廊!治疗室")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|DHCNurBloodTourPda^FormName|输血巡视^FormSort|4^FormType|TOUR^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|CommPatInfo^FormName|患者信息^FormSort|5^FormType|PAT^LabelFlag|^SimpleFlag|^HospId|2")
   w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|CommOrderInfo^FormName|医嘱信息^FormSort|6^FormType|ORDER^LabelFlag|^SimpleFlag|^HospId|2")
  
  
   //3，模板字段配置 CF.NUR.MNISV3.ModelItem  子表
    //输入类: O 下拉  M 多选 R 单选  E 填写框 D 日期 TI 时间等
   // ModelCode 模板代码 + ItemCode 字段代码 --->索引(新建或更新)
   // 键盘类型 1,体征键盘 "TEMP" 2,对于Android类型: 文本TYPE_CLASS_TEXT=1; 数字TYPE_CLASS_NUMBER=2; TYPE_NUMBER_FLAG_DECIMAL=2000
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurGradeTourPda^ItemName|巡视日期^ItemCode|DHCNurTourDate^ItemType|D^Position|1,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurGradeTourPda^ItemName|巡视时间^ItemCode|DHCNurTourTime^ItemType|TI^Position|2,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurGradeTourPda^ItemName|是否离房^ItemCode|DHCNurTourIfOut^ItemType|R^Position|3,1^ItemOption|是!否")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurGradeTourPda^ItemName|离开原因^ItemCode|DHCNurTourIfOutRes^ItemType|R^Position|4,1^ItemOption|外出!请假")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurGradeTourPda^ItemName|总体状况^ItemCode|DHCNurTourSTAT^ItemType|R^Position|5,1^ItemOption|正常!意识模糊")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurGradeTourPda^ItemName|体位^ItemCode|DHCNurTourTW^ItemType|R^Position|6,1^ItemOption|仰卧位!俯卧位!侧卧位!端坐位")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|8^ModelCode|DHCNurInfusionTourPda^ItemName|管道情况^ItemCode|DHCNurTourTunnelSTAT^ItemType|R^Position|7,1^ItemOption|污浊!通畅")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|9^ModelCode|DHCNurInfusionTourPda^ItemName|巡视日期^ItemCode|DHCNurTourDate^ItemType|D^Position|1,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|9^ModelCode|DHCNurInfusionTourPda^ItemName|巡视时间^ItemCode|DHCNurTourTime^ItemType|TI^Position|2,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|9^ModelCode|DHCNurInfusionTourPda^ItemName|巡视操作^ItemCode|DHCNurTourInspectHandle^ItemType|R^Position|3,1^ItemOption|穿刺!巡视!续液!拔针")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|9^ModelCode|DHCNurInfusionTourPda^ItemName|输液情况^ItemCode|DHCNurTourInspectSTAT^ItemType|R^Position|4,1^ItemOption|正常!鼓针!发冷")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|9^ModelCode|DHCNurInfusionTourPda^ItemName|异常处理措施^ItemCode|DHCNurTourInspectDeal^ItemType|R^Position|5,1^ItemOption|重新穿刺!调整滴速")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|9^ModelCode|DHCNurInfusionTourPda^ItemName|滴速^ItemCode|DHCNurTourInspectSP^ItemType|E^Position|6,1^KeyboardType|2")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|10^ModelCode|DHCNurSpotTourPda^ItemName|巡视日期^ItemCode|DHCNurTourDate^ItemType|D^Position|1,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|10^ModelCode|DHCNurSpotTourPda^ItemName|巡视时间^ItemCode|DHCNurTourTime^ItemType|TI^Position|2,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|10^ModelCode|DHCNurSpotTourPda^ItemName|巡视地点^ItemCode|DHCNurTourSpot^ItemType|R^Position|3,1^ItemOption|开水房!走廊!治疗室!其他")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|10^ModelCode|DHCNurSpotTourPda^ItemName|其他^ItemCode|DHCNurTourInspectSTAT^ItemType|E^Position|4,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|11^ModelCode|DHCNurBloodTourPda^ItemName|巡视日期^ItemCode|DHCNurTourDate^ItemType|D^Position|1,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|11^ModelCode|DHCNurBloodTourPda^ItemName|巡视时间^ItemCode|DHCNurTourTime^ItemType|TI^Position|2,1")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|11^ModelCode|DHCNurBloodTourPda^ItemName|巡视操作^ItemCode|DHCNurTourInspectDeal^ItemType|R^Position|3,1^ItemOption|重新穿刺!调整滴速")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|11^ModelCode|DHCNurBloodTourPda^ItemName|备注^ItemCode|DHCNurTourBloodNotes^ItemType|E^Position|4,1")
   //患者信息
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|12^ModelCode|CommPatInfo^ItemName|姓名^ItemCode|PatName^ItemType|T^Position|1,1^LinkCode|^DataSource|output/patInfo/name^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|12^ModelCode|CommPatInfo^ItemName|床号^ItemCode|BedCode^ItemType|T^Position|1,2^LinkCode|^DataSource|output/patInfo/bedCode^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|12^ModelCode|CommPatInfo^ItemName|科室^ItemCode|PatLoc^ItemType|T^Position|2,1^LinkCode|^DataSource|output/patInfo/wardDesc^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|12^ModelCode|CommPatInfo^ItemName|性别^ItemCode|PatSex^ItemType|T^Position|2,2^LinkCode|^DataSource|output/patInfo/sex^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|12^ModelCode|CommPatInfo^ItemName|登记号^ItemCode|PatRegNo^ItemType|T^Position|3,1^LinkCode|^DataSource|output/patInfo/regNo^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|12^ModelCode|CommPatInfo^ItemName|年龄^ItemCode|PatAge^ItemType|T^Position|3,2^LinkCode|^DataSource|output/patInfo/age^LabelFlag|N")
   //医嘱信息
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|13^ModelCode|CommOrderInfo^ItemName|医嘱^ItemCode|arcimDesc^ItemType|T^Position|1,1^LinkCode|^DataSource|output/orders//arcimDesc^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|13^ModelCode|CommOrderInfo^ItemName|剂量^ItemCode|doseQtyUnit^ItemType|T^Position|2,1^LinkCode|^DataSource|output/orders//doseQtyUnit^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|13^ModelCode|CommOrderInfo^ItemName|医生^ItemCode|PatLoc^ItemType|T^Position|2,2^LinkCode|^DataSource|output/orders//ctcpDesc^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|13^ModelCode|CommOrderInfo^ItemName|用途^ItemCode|PatSex^ItemType|T^Position|2,3^LinkCode|^DataSource|output/orders//phcinDesc^LabelFlag|N")
   w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|13^ModelCode|CommOrderInfo^ItemName|要求执行时间^ItemCode|PatRegNo^ItemType|T^Position|3,1^LinkCode|^DataSource|output/orders//sttDateTime^LabelFlag|N")
}

/// 第三步: 初始化 患者交接配置信息 *******必须按步骤来,因为有些id是写死的 *******
/// d ##class(Nur.MNISV3.Init).pho()
ClassMethod pho()
{
    //交接类型
    w ##class(CF.NUR.MNISV3.PHOType).Save("","TypeName|手术^TypeCode|SS^TypeSort|1^HospId|2^")
    w ##class(CF.NUR.MNISV3.PHOType).Save("","TypeName|转科^TypeCode|ZK^TypeSort|2^HospId|2^")
    //交接节点
    w ##class(CF.NUR.MNISV3.PHONode).Save("","PHOTypeId|1^NodeName|入手术室^NodeCode|RSSS^NodeSort|1^PHOModel|ComPHO!SQJJD")
    w ##class(CF.NUR.MNISV3.PHONode).Save("","PHOTypeId|1^NodeName|出手术室^NodeCode|CSSS^NodeSort|2^PHOModel|ComPHO!SHJJD")
    w ##class(CF.NUR.MNISV3.PHONode).Save("","PHOTypeId|2^NodeName|急诊转住院^NodeCode|JJZZY^NodeSort|1^PHOModel|ComPHO!ZKJJD")
    w ##class(CF.NUR.MNISV3.PHONode).Save("","PHOTypeId|2^NodeName|转科^NodeCode|ZK^NodeSort|2^PHOModel|ComPHO!ZKJJD")
    w ##class(CF.NUR.MNISV3.PHONode).Save("","PHOTypeId|2^NodeName|转院^NodeCode|ZY^NodeSort|3^PHOModel|ComPHO!ZKJJD")
    w "----",!
    //2，模板组件 CF.NUR.MNISV3.ModelForm  父表
    //子表 Relationship ChildRec As CF.NUR.MNISV3.ModelItem
    //1-ID 2-FormCode模板代码(索引-新建或更新) 3-FormName模板名称  4-FormSort顺序  5-LabelFlag标签显示 6-SimpleFlag精简标记 7-HospId
    w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|ComPHO^FormName|公共交接配置^FormSort|0^FormType|PHO^LabelFlag|^SimpleFlag|^HospId|2")
    w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|SQJJD^FormName|术前交接单^FormSort|1^FormType|PHO^LabelFlag|^SimpleFlag|^HospId|2")
    w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|SHJJD^FormName|术后交接单^FormSort|2^FormType|PHO^LabelFlag|^SimpleFlag|^HospId|2")
    w ##class(CF.NUR.MNISV3.ModelForm).Save("","FormCode|ZKJJD^FormName|转科交接单^FormSort|3^FormType|PHO^LabelFlag|^SimpleFlag|^HospId|2")
    
    //公共
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|导管^ItemCode|Catheter^ItemType|M^Position|1,1^ItemOption|鼻导管!胃导管!尿导管^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|留置针^ItemCode|Needle^ItemType|R^Position|2,1^ItemOption|是!否^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|注意事项^ItemCode|Notice^ItemType|E^Position|3,1^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|交接日期^ItemCode|HODate^ItemType|D^Position|4,1^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|交接时间^ItemCode|HOTime^ItemType|Ti^Position|5,1^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|交接人^ItemCode|HOUser^ItemType|E^Position|6,1^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|14^ModelCode|ComPHO^ItemName|接收人^ItemCode|HRUser^ItemType|E^Position|7,1^RequiredFlag|Y")
    //术前交接单
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|15^ModelCode|SQJJD^ItemName|体温^ItemCode|T^ItemType|E^Position|1,1^RequiredFlag|Y^KeyboardType|TEMP")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|15^ModelCode|SQJJD^ItemName|脉搏^ItemCode|P^ItemType|E^Position|2,1^RequiredFlag|Y^KeyboardType|2")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|15^ModelCode|SQJJD^ItemName|呼吸^ItemCode|R^ItemType|E^Position|3,1^RequiredFlag|Y^KeyboardType|2")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|15^ModelCode|SQJJD^ItemName|收缩压^ItemCode|SP^ItemType|E^Position|4,1^RequiredFlag|Y^KeyboardType|2")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|15^ModelCode|SQJJD^ItemName|舒张压^ItemCode|DP^ItemType|E^Position|5,1^RequiredFlag|Y^KeyboardType|2")
    //术后交接单
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|16^ModelCode|SHJJD^ItemName|体温^ItemCode|T^ItemType|E^Position|1,1^RequiredFlag|Y^KeyboardType|TEMP")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|16^ModelCode|SHJJD^ItemName|脉搏^ItemCode|P^ItemType|E^Position|2,1^RequiredFlag|Y^KeyboardType|2")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|16^ModelCode|SHJJD^ItemName|呼吸^ItemCode|R^ItemType|E^Position|3,1^RequiredFlag|Y^KeyboardType|2")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|16^ModelCode|SHJJD^ItemName|收缩压^ItemCode|SP^ItemType|E^Position|4,1^RequiredFlag|Y^KeyboardType|2")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|16^ModelCode|SHJJD^ItemName|舒张压^ItemCode|DP^ItemType|E^Position|5,1^RequiredFlag|Y^KeyboardType|2")
    //转科交接单         
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|17^ModelCode|ZKJJD^ItemName|转出科室^ItemCode|OutWard^ItemType|E^Position|1,1^RequiredFlag|Y")
    w ##class(CF.NUR.MNISV3.ModelItem).Save("","ModeFormId|17^ModelCode|ZKJJD^ItemName|转入科室^ItemCode|InWard^ItemType|E^Position|2,1^RequiredFlag|Y")
}

/// 初始化 工作统计类型表(输液) 
/// d ##class(Nur.MNISV3.Init).workType()
ClassMethod workType() As %Status
{
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Despensing^配液^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("AuditDes^复核^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Puncture^穿刺^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Change^续液^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Tour^巡视^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Suspend^暂停^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Continue^继续^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Stop^停止^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("Finish^拔针^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("AutoFinish^续液完成^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("PutOrd^摆药^")
    w ##class(CF.NUR.MNISV3.IPIFWorkType).Save("JPRec^接收^")
}

}
